import request from '@/utils/request.js'

/**
 *获取所有频道列表
 * @returns promise
 */
export const getAllChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels'
  })
}

/**
 *添加频道
 * @param {*} obj {id:频道id，seq:序号}
 * @returns
 */
export const addUserChannels = obj => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [obj]
    }
  })
}

export const deleteUserChannels = channelId => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${channelId}`
  })
}
